package org.jsystemtest.course.tests;

import java.io.File;
import java.io.IOException;

import org.junit.Test;

import jsystem.utils.FileUtils;
import jsystem.utils.MailUtil;
import junit.framework.SystemTestCase4;

public class UtilsOperations extends SystemTestCase4 {

	/**
	 *  * a) address to send from (user@domain.com)<br> 
 * b) sender user name (user)<br>
 * c) sender password (password)<br>
 * d) mail host (for example: smtp.gmail.com for gmail)<br>
 * e) is host secured (ssl true)<br>
 * f) sending host port number (465 for gmail)<br>
 * g) mail to send to<br>
 *</UL>
 * 3) use <I>sendMail(Title,Message)</I> to send a message with a given title
	 * @throws Exception 
	 */
	@Test
	public void testFileUtils() throws Exception {
//		FileUtils.copyDirectory(new File("c:\\jsystem\\runner\\log\\current"),new File("c:\\temp\\log"));
		MailUtil mail = new MailUtil();
		mail.init();
		mail.setUserName("itai.agmon@gmail.com");
		mail.setPassword("password");
		mail.setSmtpHostName("smtp.gmail.com");
		mail.setSmtpPort(465);
		mail.setSsl(true);
		mail.setSendTo("itai.agmon@gmail.com");
		mail.sendMail("New Mail", "Some content");
		
	}
	
	@Test
	public void testUnzip() throws IOException{
		FileUtils.extractZipFile(new File("C:\\jsystem\\runner\\log\\old","log_Sun_Mar_06_10_51_35_IST_2011.zip"), new File("c:\\temp"));
		
		
		
	}

}
